package myschool.service;


import myschool.dao.AdminDao;
import myschool.entity.Admin;
import myschool.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

public class AdminService {
    public static final AdminService ME = new AdminService();

    public Admin login(String s, String password) {
        SqlSession session = MybatisUtil.get();
        try {
            AdminDao mapper = session.getMapper(AdminDao.class);
            Admin search = mapper.login(s, password);
            return search;
        } finally {
            MybatisUtil.close(session);
        }
    }

    ;
}
